  <template>
    <div>
        <b-row class="mt-3">
            <b-col>
                <Table stripe border :columns="columns" :data="data" :loading="loading" :heigth="height" :width="width" :size="size"></Table>
            </b-col>
        </b-row>
        <!-- <sky-pagination v-if="showPagination" :total-page="totalPage"></sky-pagination> -->
    </div>
</template> 


<style>
.ivu-table-tip{
    overflow-x:hidden;
}
</style>

<script>
export default {
    name: "SkyTable",
    props: {
        //列配置
        columns: {
            type: Array,
            required: true
        },
        //本地数据
        data: {
            type: Array
        },
        // 请求数据URL
        url: {
            type: String
        },
        //是否显示序号
        showIndex: {
            type: Boolean,
            default: false
        },
        //是否显示分页
        showPagination: {
            type: Boolean,
            default: true
        },
        // 固定高度
        height: {
            type: Number
        },
        // 固定宽度
        width: {
            type: Number
        },
        // 表格大小规则
        size: {
            type: String,
            default: "default" // large/small/default
        }
    },
    data: () => ({
        loading: false,
        totalPage: 50
    }),
    created () {
        //显示序号
        if (this.showIndex) {
            this.columns.unshift({
                title: '#',
                type: 'index',
                width: 60,
                align: 'center'
            })
        }
        // console.log(this.columns)
        //初始化总页数
        if (this.showPagination && this.data) {
            this.totalPage = this.data.length;
        }
        // console.log(this.data)
    }
};
</script>
